c3c969213cd59916576df656b91bbb9499428283,advanced/main/java/org/neo4j/kernel/HighlyAvailableGraphDatabase.java,HighlyAvailableGraphDatabase,getSlaveContext,#,347

Before Change


    
    public SlaveContext getSlaveContext()
    {
        Config config = getConfig();
        Map<String, Long> txs = new HashMap<String, Long>();
        for ( XaDataSource dataSource :
                config.getTxModule().getXaDataSourceManager().getAllRegisteredDataSources() )
        {
            txs.put( dataSource.getName(), dataSource.getLastCommittedTxId() );
        }
//        System.out.println( "Sending slaveContext:" + machineId + ", " + txs );
        return new SlaveContext( machineId, txs );

After Change


    
    public SlaveContext getSlaveContext()
    {
        Collection<XaDataSource> dataSources = localDataSourceManager.getAllRegisteredDataSources();
        @SuppressWarnings("unchecked")
        Pair<String, Long>[] txs = new Pair[dataSources.size()];
        int i = 0;
        for ( XaDataSource dataSource : dataSources )
        {
            txs[i++] = new Pair<String, Long>( 
                    dataSource.getName(), dataSource.getLastCommittedTxId() );
        }
        return new SlaveContext( machineId, txs );
    }